<!DOCTYPE html>
<html style="height:100%;">
<head lang="en">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <meta name="format-detection" content="telephone=no" />
    <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
    <meta http-equiv="Pragma" content="no-cache" />
    <meta http-equiv="Expires" content="0" />
    <script src="javascripts/dragloader.js"></script>
    <link rel="stylesheet" href="stylesheets/zui.min.css"/>
    <link rel="stylesheet" href="stylesheets/main.css" id="css"/>
    <script src="javascripts/jquery-1.10.1.min.js"></script>
    <script src="javascripts/zui.min.js"></script>
    <script src="javascripts/footer.js"></script>
    <title>斯迈普解盘侠</title>
    <style type="text/css">
    	.nav{
    		position:relative;
    		padding-left:5px;
    		background-color:#e24344;
    		height:50px;
    		line-height:50px;
    		widht:100%;
    		text-align: center;
    		font-size:2rem;
    		color:white;
    	}
    	.goback{
    		position: absolute; 
    		left: 5px;
    		font-size:1.6rem;
    	}
    	.info_detail{
    		padding-left:20px;
    		padding-right:20px;
    		padding-bottom:10px;
    		height:85%;
     		overflow-y:scroll; 
    	}
    	.info_title{
    		text-align:center;
    		font: 2.1rem 'Microsoft YaHei', sans-serif;
    	}
    	.info_date{
    		width:100%;
    		text-align: center;
    		font-size:1.4rem;
    		color:#cfcfcf;
    		padding-left: 5px;
    		padding-right: 5px;
    	}
    	.info_content{
    		font: 1.6rem 'Microsoft YaHei', sans-serif;
    	}
    	.info_loading{
    		width:100%;
    		margin-top:10px;
    		text-align:center;
    		display:none;
    	}
    </style>
</head>
<body>
	<input type="hidden" id="type"/>
	<div class="info_detail" style="margin-top: 10px;">
		<div class="info_loading"><img src="./images/loading.gif"> <span>数据加载中，请稍候……</span></div>
		<div class="info_title">
		</div>
		<div class="info_date"></div>
		<div class="info_content"></div>
	</div>

	 <footer class="nav-footer">
			<div class="col-xs-3" id="hall" >
				<i class="icon icon-home"></i>
				<h4>解盘</h4>
			</div>
			<div class="col-xs-3" id="notify"  >
				<i class="icon icon-volume-up"></i>
				<h4>喊单</h4>
			</div>
			<div class="col-xs-3  footer-nav-active" id= "news" >
				<i class="icon icon-globe"></i>
				<h4>资讯</h4>
			</div>
			<div class="col-xs-3" id="my" >
				<i class="icon icon-user"></i>
				<h4>个人中心</h4>
			</div>
</footer>
</body>

<script type="text/javascript">

	infoNavActive();
	
    /**
     * 资讯导航头选中状态
     */
    function infoNavActive(){
        var $box = $(".info-nav-box>div");
        $box.click(function () {
            var $this = $(this);
            $box.removeClass("info-nav-active");
            $this.addClass("info-nav-active");
        });
    }
    
    //初始化
    init();
    
    function init(){
    	 var params = decodeURI(window.location.search.replace('?',''));
    	 var paramArr = params.split("&");
    	 var obj = new Object();
    	 for(var i = 0 ; i < paramArr.length ; i++){
    		 var arr = paramArr[i].split("=");
			obj[arr[0]] = arr[1];     		 
    	 }
    	 
    	 
    	 document.title = obj.tCtn;
    	var id = obj.id;
    	
    	//设置咨询内容高度
    	var h = $(document).height() - $('.nav-footer').height() - $('.nav').height();
    	$('.info_detail').css('height',h);
    	 
    	$('.info_loading').show();
    	//加载数据信息
    	loadData(id);
    }
    
    function loadData(id){
    	var uri = "../newsController/showDetail.do";
    	$.ajax({
    		url : uri,
    		data : {id:id},
    		success : function(data){
    			var dataObj = eval('(' + data + ')');
    			if(dataObj.success){
	    			var result = dataObj.data;
	    			//标题
	    			$('.info_title').html(result.title);
	    			$('.info_date').html(result.source + ' | ' + result.publishTime);
	    			$('.info_content').html(result.content);
    			}
    			$('.info_loading').hide();
    		},
    		error : function(){
    		},
    	});
    }
    
    function goBack(){
    	window.location.href = "information.html?tCtn="+$('#tCtn').text();
    }
</script>
</html>